import sys
from pathlib import Path
# 获取当前执行脚本的路径
script_dir = Path(__file__).parent
# 获取 llmweb 模块的路径
llmweb_dir = script_dir.parent

# 将 llmweb 目录的路径添加到 sys.path
sys.path.append(str(llmweb_dir))
from llmweb import BrowserPool, KimLLM
import asyncio
import time
async def main():
    pool = BrowserPool(headless=False, pool_size=1, workdir="pool")
    await pool.initialize()
    kimi = KimLLM(pool)
    # await kimi.login()
    answer = kimi.generate("用100字介绍下你自己")
    async for a in answer:
        print(a)
   
    await pool.close()
    
     
if __name__ == "__main__":
    asyncio.run(main())